﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _2_1_Variables
{
    class Program
    {
        public int INT = 0;
        static void Main(string[] args)
        {

            int A = 1234567;
            do
            {
                Console.WriteLine(A % 10);
                A /= 10;

            } while (A > 0);

            byte B = 1;
            short S = 256;
            B = (byte)S;
            Console.WriteLine(B);

            Console.ReadKey();
            int aa = 2;
            int bb = 3;
            int cc = 4;

            //Console.WriteLine((c=1) && (c=3) && (c=5));

            //Console.WriteLine(a = b == a);
            //自增，自减
            int ii, jj;
            ii = 3;
            jj = 2;
            Console.WriteLine((ii)++ + jj);
            ii = 6;
            Console.WriteLine(ii++);
            Console.WriteLine(ii);
            Console.WriteLine(++ii);
            Console.WriteLine(ii);
            //求余
            int i = 3, j = 2;
            Console.WriteLine(3 % -2);
            Console.WriteLine(i/(float)j);
            Console.ReadKey();
            //字符，转义字符
            char a, b, c, d , n1, n2;
            a = 'A';
            b = (char)65;
            c = '\x41';
            d = (char)0x41;
            Console.WriteLine(a);
            Console.WriteLine(b);
            Console.WriteLine(c);
            Console.WriteLine(d);
            n1 = '\n';      //转义字符：回车
            n2 = '\t';       //转义字符：下一个输出区(Tab)
            Console.WriteLine("使用转义字符\n");
       
            Console.Write("c1 =" +a + n2 + "c2 =" +b + "\n");
            Console.Write("c3 =" +c + n2 + "c4 =" +d + n1);


            Console.ReadKey();
            //输出各种类型的最大值最小值 
            Console.WriteLine("short MinValue:" + short.MinValue + "   MaxValue:" + short.MaxValue + " Byte Num: " + sizeof(short));
            Console.WriteLine("int   MinValue:" + int.MinValue + "   MaxValue:" + int.MaxValue + " Byte Num: " + sizeof(int));
            Console.WriteLine("float   MinValue:" + float.MinValue + "   MaxValue:" + float.MaxValue + " Byte Num: " + sizeof(float));
            Console.WriteLine("double   MinValue:" + double.MinValue + "   MaxValue:" + double.MaxValue + " Byte Num: " + sizeof(double));

            Console.ReadKey ();
        }
    }
}
